package com.linkwings.projectsimple.service.impl;

import java.util.List;

import com.linkwings.projectsimple.dao.UserinfoDao;
import com.linkwings.projectsimple.pojo.Bookcat;
import com.linkwings.projectsimple.pojo.SampleUser;
import com.linkwings.projectsimple.pojo.Book;
import com.linkwings.projectsimple.service.UserService;

public class UserServiceImpl implements UserService {

	private UserinfoDao userinfoDao;

	public void delUserById(int id) {
	   userinfoDao.deleteObjectByPk(id, SampleUser.class);
	}

	public List<SampleUser> findListUser() {
		return userinfoDao.findListUser();
	}

	public SampleUser findUserById(int id) {
		return userinfoDao.findUserById(id);
	}

	public void saveOrUpdateUser(SampleUser user) {
		userinfoDao.saveOrUpdate(user);
	}

	public void setUserinfoDao(UserinfoDao userinfoDao) {
		this.userinfoDao = userinfoDao;
	}

	public Bookcat findBCByID(int id){
		return userinfoDao.findBCByID(id);
	}
	
	public Book findBookByID(int id){
		return userinfoDao.findBookByID(id);
	}
	
}
